package com.cjm.one.model.goods.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.cjm.one.model.base.BaseEntity;

import java.io.Serializable;

@TableName(value ="goods_cart")
public class GoodsCart extends BaseEntity {


    /**
     * skuID
     */
    private Long skuId;

    /**
     * 用户id
     */
    private Long customerId;



    /**
     * 选中标志 0 ，1  选中
     */
    private Integer selected;

    /**
     * 商品数量
     */
    private Integer goodsNum;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * 
     */

    /**
     * skuID
     */
    public Long getSkuId() {
        return skuId;
    }

    /**
     * skuID
     */
    public void setSkuId(Long skuId) {
        this.skuId = skuId;
    }

    /**
     * 用户id
     */
    public Long getCustomerId() {
        return customerId;
    }

    /**
     * 用户id
     */
    public void setCustomerId(Long customerId) {
        this.customerId = customerId;
    }

    private Long goodsId;


    /**
     * 选中标志 0 ，1  选中
     */
    public Integer getSelected() {
        return selected;
    }

    /**
     * 选中标志 0 ，1  选中
     */
    public void setSelected(Integer selected) {
        this.selected = selected;
    }

    public Long getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(Long goodsId) {
        this.goodsId = goodsId;
    }

    /**
     * 商品数量
     */
    public Integer getGoodsNum() {
        return goodsNum;
    }

    /**
     * 商品数量
     */
    public void setGoodsNum(Integer goodsNum) {
        this.goodsNum = goodsNum;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        GoodsCart other = (GoodsCart) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getSkuId() == null ? other.getSkuId() == null : this.getSkuId().equals(other.getSkuId()))
            && (this.getCustomerId() == null ? other.getCustomerId() == null : this.getCustomerId().equals(other.getCustomerId()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getIsDeleted() == null ? other.getIsDeleted() == null : this.getIsDeleted().equals(other.getIsDeleted()))
            && (this.getSelected() == null ? other.getSelected() == null : this.getSelected().equals(other.getSelected()))
            && (this.getGoodsNum() == null ? other.getGoodsNum() == null : this.getGoodsNum().equals(other.getGoodsNum()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getSkuId() == null) ? 0 : getSkuId().hashCode());
        result = prime * result + ((getCustomerId() == null) ? 0 : getCustomerId().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getIsDeleted() == null) ? 0 : getIsDeleted().hashCode());
        result = prime * result + ((getSelected() == null) ? 0 : getSelected().hashCode());
        result = prime * result + ((getGoodsNum() == null) ? 0 : getGoodsNum().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(super.getId());
        sb.append(", skuId=").append(skuId);
        sb.append(", customerId=").append(customerId);
        sb.append(", createTime=").append(super.getCreateTime());
        sb.append(", updateTime=").append(super.getUpdateTime());
        sb.append(", isDeleted=").append(super.getIsDeleted());
        sb.append(", selected=").append(selected);
        sb.append(", goodsNum=").append(goodsNum);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}